package cn.dt70.services.impl;

import cn.dt70.dao.basicApp.BasicAppInfoMapper;
import cn.dt70.pojo.AppCategory;
import cn.dt70.pojo.AppInfo;
import cn.dt70.pojo.DataDictionary;
import cn.dt70.services.BasicAppInfoService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("basicAppInfoService")
public class BasicAppInfoServiceImpl implements BasicAppInfoService {
    private static final Logger logger=Logger.getLogger( BasicAppInfoServiceImpl.class );
    @Resource
    private BasicAppInfoMapper basicAppInfoMapper;


    @Override
    public boolean add(AppInfo appInfo) {
        // TODO Auto-generated method stub
        boolean flag = false;
        try {
            if(basicAppInfoMapper.add(appInfo) > 0){
                flag = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }
    @Override
    public AppInfo getAppInfo(Integer id,String APKName) throws Exception{



            return basicAppInfoMapper.getAppInfo(id, APKName);

    }
    @Override
    public List<AppCategory> getAppCategoryListByParentId(Integer parentId)
            throws Exception {

        return basicAppInfoMapper.getAppCategoryListByParentId(parentId);
    }
    @Override
    public List<DataDictionary> getDataDictionaryList(String typeCode)
            throws Exception {
        // TODO Auto-generated method stub
        return basicAppInfoMapper.getDataDictionaryList(typeCode);
    }

}
